import { $Http } from '@/config/service/http';

export enum Api {
  advancedQueryPage = '/dmsfile/advancedQuery/page', // 条件分页查询
  advancedQueryPreview = '/dmsfile/advancedQuery/preview', // 预览
  advancedQueryPreviewByVersionId = '/dmsfile/advancedQuery/previewByVersionId', // 版本预览
  advancedQueryDownload = '/dmsfile/advancedQuery/download/', // 下载
  advancedQueryBatchDownload = '/dmsfile/advancedQuery/batchDownload', // 批量下载
  advancedQueryArchivesTypeTree = '/dmsfile/commonFileDirectory/tree', // 查询文件类型目录树
  advancedQueryFindPageByTypeId = '/dmsfile/advancedQuery/findPageByTypeId', // 文件类型分页查询
  advancedQueryVersionPageByFileId = '/dmsfile/advancedQuery/versionPageByFileId', // 获取历史版本
  dmsAdvancedQueryPreview = '/dms/advancedQuery/preview' // 新预览接口
}

export const advancedQueryPreview = (id, params) => {
  return $Http.api(Api.advancedQueryPreview + '/' + id, params, 'post');
};

export const dmsAdvancedQueryPreview = (params) => {
  return $Http.api(Api.dmsAdvancedQueryPreview, params, 'post');
};

export const advancedQueryDownload = (id, params) => {
  return $Http.api(Api.advancedQueryDownload + '/' + id, params, 'get');
};

export const advancedQueryBatchDownload = (params) => {
  return $Http.api(Api.advancedQueryBatchDownload, params, 'post');
};

export const advancedQueryArchivesTypeTree = (params) => {
  return $Http.api(Api.advancedQueryArchivesTypeTree, params, 'post');
};

export const advancedQueryPreviewByVersionId = (id, params) => {
  return $Http.api(Api.advancedQueryPreviewByVersionId + '/' + id, params, 'post');
};

export const advancedQueryVersionPageByFileId = (params) => {
  return $Http.api(Api.advancedQueryVersionPageByFileId, params, 'post');
};
